package com.shqcjd.preinstallmobile.ui.adapter;

import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.shqcjd.preinstallmobile.R;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 专家类型
 * Created by sy on 2019/3/19.
 */

public class ExpertTypeAdapter extends BaseQuickAdapter<String,ExpertTypeAdapter.ViewHolder> {

    public ExpertTypeAdapter(@Nullable List<String> data) {
        super(R.layout.item_expert_type, data);
    }

    @Override
    protected void convert(ExpertTypeAdapter.ViewHolder helper, String item) {
        switch (helper.getLayoutPosition()) {
            case 0:
                helper.iv_icon.setImageDrawable(ContextCompat.getDrawable(mContext,R.mipmap.ic_zj_type));
                helper.tv_name.setText("专家");
                break;
            case 1:
                helper.iv_icon.setImageDrawable(ContextCompat.getDrawable(mContext,R.mipmap.ic_zg_type));
                helper.tv_name.setText("专工");
                break;
            case 2:
                helper.iv_icon.setImageDrawable(ContextCompat.getDrawable(mContext,R.mipmap.ic_gys_type));
                helper.tv_name.setText("厂商");
                break;
        }
    }

    class ViewHolder extends BaseViewHolder {
        @BindView(R.id.iv_icon)
        ImageView iv_icon;
        @BindView(R.id.tv_name)
        TextView tv_name;
        public ViewHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }
    }

}
